<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>bug check page</title>
    <title>check case detail</title>
    <style>
    table{border-collapse:collapse;border-spacing:0;border-left:1px solid #888;border-top:1px solid #888;margin: auto}
    th,td{border-right:1px solid #888;border-bottom:1px solid #888;padding:5px 15px;}
    th{font-weight:bold;}
    body{text-align: center}
    </style>
    {% load static %}
    <script type='text/javascript' src="/static/js/jquery.min.js"></script>
    <script type='text/javascript' src="/static/js/user.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("#submit").click(function(){
                $("form[name='dataForm']").submit();
            });
        });
    </script>
</head>
<body>
    <form name="dataForm" action="/bugCheck/" method="post">
        <table>
            <tr>
                <td>选择项目:</td>
                <td>

                    {% csrf_token %}
                    <select name="projectId" id="projectId">
                        {% for project in projects %}
                        <option value="{{ project.id }}" {% if projectId == project.id %}selected{% endif %}>{{ project.projectName }}</option>
                        {% endfor %}
                    </select>
                </td>
                <td>
                    阶段:
                </td>
                <td>
                    <select name="stage" id="stage">
                        <option value="1">SIT</option>
                        <option value="2">SVT</option>
                    </select>
                </td>
                <td><input type="button" value="查询" name="submit"></td>
            </tr>
        </table><br>
    </form>
    <table>
        <tr>
            <td>序号</td>
            <td>测试模块</td>
            <td>测试用例</td>
            <td>bug题目</td>
            <td>提交人</td>
            <td>状态</td>
        </tr>
    {% for bug in bugList %}
        <tr>
            <td>{{ forloop.counter }}</td>
            <td>{{ bug.case.caseTitle }}</td>
            <td>{{ bug.caseDetail.caseDetailTitle }}</td>
            <td>{{ bug.bugInfo.title }}</td>
            <td>{{ bug.woker.showName }}</td>
            {% if bug.bugInfo.state == '0' %}
                <td style="background-color: red;cursor:pointer" name="showBugTd">FAIL</td>
            {% else %}
               <td style="background-color: green">PASS</td>
            {% endif %}
        </tr>
        {% if bug.bugInfo.state == '0' %}
        <tr style="display: none" name="showBugTr">
            <td colspan="6" style="text-align: left">
                {% autoescape off %}
                    {{ bug.bugInfo.comment }}<br>
                    {% for upFile in bug.upFiles %}
                        <a href="/showImage/?imgSrc={{ upFile.img }}" target="_blank">{{ upFile.imgName }}</a> &nbsp;&nbsp;
                    {% endfor %}
                {% endautoescape %}
            </td>
        </tr>
        {% endif %}
    {% endfor %}
    </table>
</table>
</body>
</html>